class ClientController < ApplicationController

  def index
	@clients_all = Client.clients_all
	
  end
  
  def new
  @client = Client.new
  end


def create
    @client = Client.new(params[:client])
    
    if @client.save
      flash[:notice] = 'Client profile was successfully created.'
      redirect_to :action => "index"
    else
      render :action => "new"
    end
  end

def show
@client = Client.find(params[:id])
end

def edit
@client = Client.find(params[:id])
end

def update
    @client = Client.find(params[:id])

    if @client.update_attributes(params[:client]) 
      flash[:notice] = 'Client info was updated.'
      redirect_to :action => "show", :id => params[:id]
    else
      render :action => "edit"
end
end

def destroy
@client = Client.find(params[:id])
@client.destroy
flash[:notice] = 'Client was permanently deleted from the system.'
redirect_to :action => "index"
end
    

end
